

 class Thing{
    public int price=10;
    public String name="铅笔";
    public String color="黑色";
}
class Pencil implements Cloneable{
    public int price=10;
    public String name="铅笔";
    public String color="黑色";

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

public class Clone {
    public static void main(String[] args) throws CloneNotSupportedException {


        Thing thing1 = new Thing();
        Thing thing2=  thing1;
        thing2.name="56";
        System.out.println(thing1.name+"  "+thing2.name);

        Pencil pencil = new Pencil();
        Pencil pencil1 = (Pencil) pencil.clone();
        pencil1.name="79";
        System.out.println(pencil.name+"  "+pencil1.name);

        String s1 = new String("abc");
        String s2 = new String("acd");
        String s3 = new String("ABC");
       int a= s1.compareTo(s2);
        System.out.println(a);
        int b = s1.compareToIgnoreCase(s3);
        System.out.println(b);

        System.out.println(s1.charAt(2));
        System.out.println(s1.indexOf("b"));
        String s4 = String.format("%d-%d-%d",2024,3,4);
        System.out.println(s4);
    }



}
